package com.situ.gcbs.server.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 功能：openApi配置，如果配置了其它拦截器，则一定要放行/swagger**\/**和\/**\/api-docs\/**"
 *
 * 访问地址：http://localhost:8080/swagger-ui/index.html，端口与springboot应用端口相同
 *
 * @author 千堆雪
 * @version 1.0.0
 * @since 2024/5/16
 * <p>
 * created by 千堆雪 on 2024/5/16 13:46, last modified by 千堆雪 on 2024/5/16 13:46
 */
@Configuration
public class OpenApiConfig {

    @Bean
    public OpenAPI openApi() {
        return new OpenAPI().info(getInfo());
    }

    private Info getInfo() {
        return new Info()
                .title("思泰隆健身会馆课程预约系统api接口文档")
                .version("1.0.0")
                .contact(new Contact().name("臧金玉").email("viogel4@163.com"))
                .license(new License().name("Apache 2.0").url("https://springdoc.org"))
                .description("版权所有 中享思途");
    }
}
